import React, { Component } from 'react';
import { Modal } from 'antd';

class Dialog extends Component {
    state = {
        ModalText: 'Content of the modal',
        visible: false,
        confirmLoading: false,
    }
    
    handleCancel = () => {
        this.props.onVisibleChange(false);
    }
    render() {
        /*props.form 传入的组件*/
        const FormComponent = this.props.form;
        return (
            <div>
                <Modal title="Title"
                    animated={false}
                    visible={this.props.visible}
                    onOk={this.handleOk}
                    onCancel={this.handleCancel}
                    footer={null}>
                    <FormComponent></FormComponent>
                </Modal>
            </div>
        );
    }
}

export default Dialog;